package com.gitee.dolt.boot.service;


import org.springframework.lang.NonNull;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.function.Function;

public interface IServiceCacheManager<T> {

    void setCache(@NonNull T model);

    void delCache(@NonNull T model);

    void delCache(@NonNull List<T> models);

    List<T> findByKeys(@NonNull Collection<? extends Serializable> keys, Function<Collection<? extends Serializable>, Collection<T>> loader);

    T getByKey(@NonNull Serializable key, Function<Serializable, T> loader);


}
